/*******************************************************************************
 * Size: 12 px
 * Bpp: 1
 * Opts: --no-compress --no-prefilter --bpp 1 --size 12 --font simhei.ttf -r 0x4e00-0x4e2f --format lvgl -o font_s12.c --force-fast-kern-format
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef FONT_S12
#define FONT_S12 1
#endif

#if FONT_S12

 /*-----------------
  *    BITMAPS
  *----------------*/

  /*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+4E00 "一" */
    0xff, 0xe0,

    /* U+4E01 "丁" */
    0xff, 0xe0, 0x80, 0x10, 0x2, 0x0, 0x40, 0x8,
    0x1, 0x0, 0x20, 0x4, 0x3, 0x0,

    /* U+4E02 "丂" */
    0xff, 0xe2, 0x0, 0x40, 0xf, 0xe0, 0x4, 0x1,
    0x80, 0x20, 0x4, 0x3, 0x80, 0x60,

    /* U+4E03 "七" */
    0x8, 0x1, 0x0, 0x20, 0x85, 0xe7, 0xc1, 0x10,
    0x2, 0x0, 0x40, 0x8, 0x61, 0xf8,

    /* U+4E04 "丄" */
    0x4, 0x0, 0x80, 0x10, 0x2, 0x0, 0x40, 0x8,
    0x1, 0x0, 0x20, 0xff, 0xe0,

    /* U+4E05 "丅" */
    0xff, 0xe0, 0x80, 0x10, 0x2, 0x0, 0x40, 0x8,
    0x1, 0x0, 0x20, 0x4, 0x0, 0x80,

    /* U+4E06 "丆" */
    0x7f, 0xe0, 0x80, 0x20, 0x4, 0x1, 0x0, 0x60,
    0x10, 0x0,

    /* U+4E07 "万" */
    0x7f, 0xe1, 0x0, 0x20, 0x7, 0xc0, 0x88, 0x21,
    0x4, 0x21, 0x84, 0x20, 0x88, 0x60,

    /* U+4E08 "丈" */
    0x2, 0x0, 0x41, 0xff, 0x81, 0x2, 0x20, 0x24,
    0x6, 0x80, 0x60, 0xe, 0xe, 0x3d, 0x0, 0x0,

    /* U+4E09 "三" */
    0x7f, 0xc0, 0x0, 0x0, 0x0, 0x3, 0xf8, 0x0,
    0x0, 0x0, 0x0, 0xff, 0xe0,

    /* U+4E0A "上" */
    0x8, 0x2, 0x0, 0x80, 0x3e, 0x8, 0x2, 0x0,
    0x80, 0x20, 0x8, 0x3f, 0xf0,

    /* U+4E0B "下" */
    0xff, 0xc2, 0x0, 0x80, 0x28, 0xb, 0x2, 0x60,
    0x88, 0x20, 0x8, 0x2, 0x0,

    /* U+4E0C "丌" */
    0xff, 0xe2, 0x20, 0x44, 0x8, 0x81, 0x10, 0x22,
    0x8, 0x41, 0x8, 0x41, 0x10, 0x20,

    /* U+4E0D "不" */
    0xff, 0xc1, 0x0, 0x80, 0x68, 0x29, 0x12, 0x28,
    0x84, 0x20, 0x8, 0x2, 0x0,

    /* U+4E0E "与" */
    0x20, 0x8, 0x3, 0xfc, 0x80, 0x40, 0x1f, 0xf0,
    0x7, 0xfd, 0x0, 0x40, 0x30, 0x18,

    /* U+4E0F "丏" */
    0xff, 0xc2, 0xc, 0xfa, 0x22, 0x88, 0xbf, 0xe0,
    0x8, 0x2, 0x0, 0x80, 0xc0,

    /* U+4E10 "丐" */
    0xff, 0xe0, 0x81, 0x9f, 0x22, 0x4, 0x40, 0xff,
    0x80, 0x10, 0x2, 0x0, 0x40, 0x30,

    /* U+4E11 "丑" */
    0x7f, 0x82, 0x20, 0x88, 0x22, 0x7f, 0x84, 0x41,
    0x10, 0x44, 0x11, 0x3f, 0xf0,

    /* U+4E12 "丒" */
    0xff, 0xc1, 0x8, 0x21, 0x34, 0x41, 0x88, 0x29,
    0x8, 0x26, 0x1c, 0x0, 0x1f, 0xfc,

    /* U+4E13 "专" */
    0x8, 0x2, 0x7, 0xf8, 0x20, 0xff, 0xc4, 0x1,
    0xf8, 0x4, 0x12, 0x3, 0x80, 0x0,

    /* U+4E14 "且" */
    0x3f, 0x8, 0x42, 0x10, 0xfc, 0x21, 0x8, 0x43,
    0xf0, 0x84, 0x21, 0x3f, 0xf0,

    /* U+4E15 "丕" */
    0x7f, 0xe0, 0x80, 0x30, 0xe, 0x83, 0x4c, 0xc8,
    0xe1, 0x0, 0x20, 0x0, 0x1f, 0xfc,

    /* U+4E16 "世" */
    0x9, 0x9, 0x21, 0x24, 0x24, 0x8f, 0xfe, 0x92,
    0x12, 0x42, 0x78, 0x40, 0x8, 0x1, 0xff, 0x0,

    /* U+4E17 "丗" */
    0x4, 0x2, 0x44, 0x24, 0x42, 0x44, 0xff, 0xf2,
    0x44, 0x24, 0x42, 0x44, 0x24, 0x42, 0x44, 0x3f,
    0xc0,

    /* U+4E18 "丘" */
    0x7, 0xc7, 0x0, 0x80, 0x10, 0x3, 0xfc, 0x42,
    0x8, 0x41, 0x8, 0x21, 0x1f, 0xfc,

    /* U+4E19 "丙" */
    0xff, 0xe0, 0x81, 0xff, 0x22, 0x24, 0x44, 0x94,
    0x94, 0x52, 0x8a, 0x40, 0x48, 0x38,

    /* U+4E1A "业" */
    0x9, 0x0, 0x90, 0x49, 0x24, 0x92, 0x69, 0x62,
    0x94, 0x29, 0x40, 0x90, 0x9, 0xf, 0xff,

    /* U+4E1B "丛" */
    0x31, 0x4, 0x20, 0x84, 0x10, 0x83, 0x18, 0x55,
    0x10, 0x96, 0x23, 0x0, 0x1f, 0xfc,

    /* U+4E1C "东" */
    0x8, 0x4, 0xf, 0xf8, 0x80, 0x24, 0x11, 0x7,
    0xf8, 0x10, 0x25, 0x11, 0x28, 0xc4, 0x20,

    /* U+4E1D "丝" */
    0x10, 0x84, 0x20, 0xa5, 0x25, 0x2f, 0x38, 0x21,
    0x8, 0x42, 0xdf, 0x62, 0x0, 0x3, 0xff, 0x80,

    /* U+4E1E "丞" */
    0x3f, 0x80, 0x20, 0x18, 0x7a, 0x21, 0x78, 0x4a,
    0x9, 0x3e, 0x60, 0x0, 0x1f, 0xfc,

    /* U+4E1F "丟" */
    0x7f, 0xc0, 0x80, 0xfe, 0x2, 0x0, 0x41, 0xff,
    0xc2, 0x0, 0xc8, 0x30, 0x87, 0xf8, 0x1, 0x0,

    /* U+4E20 "丠" */
    0x14, 0x5, 0x1, 0x43, 0xd6, 0x16, 0x5, 0x1,
    0x43, 0xd9, 0x13, 0xc0, 0xf, 0xfc,

    /* U+4E21 "両" */
    0xff, 0xe0, 0x81, 0xff, 0xa2, 0x15, 0x4a, 0xa9,
    0x55, 0x2a, 0xfd, 0x40, 0x28, 0x8,

    /* U+4E22 "丢" */
    0x0, 0x8f, 0xe0, 0x10, 0x3f, 0xe0, 0x40, 0x8,
    0x3f, 0xf8, 0x40, 0x11, 0x4, 0x10, 0xff, 0x0,
    0x20,

    /* U+4E23 "丣" */
    0xff, 0xc4, 0x8f, 0x3e, 0x49, 0x92, 0x7c, 0xf1,
    0x20, 0xc8, 0x62, 0x30, 0x80,

    /* U+4E24 "两" */
    0xff, 0xc4, 0x8f, 0xfe, 0x49, 0xb2, 0x6b, 0xde,
    0x5e, 0x21, 0x80, 0x60, 0x70,

    /* U+4E25 "严" */
    0x7f, 0xc2, 0x82, 0xa8, 0xaa, 0x7f, 0xd0, 0x4,
    0x1, 0x0, 0x40, 0x20, 0x0, 0x0,

    /* U+4E26 "並" */
    0x0, 0x1, 0x8, 0x11, 0x7, 0xfe, 0x9, 0x0,
    0x92, 0x29, 0x22, 0x94, 0x9, 0x0, 0x90, 0xff,
    0xf0,

    /* U+4E27 "丧" */
    0x4, 0xf, 0xf8, 0x92, 0x12, 0x40, 0x51, 0xff,
    0xc9, 0x21, 0x2c, 0x23, 0x7, 0x1c, 0x80, 0x80,

    /* U+4E28 "丨" */
    0xff, 0xe0,

    /* U+4E29 "丩" */
    0x6, 0x18, 0x61, 0x86, 0x18, 0xfd, 0x4, 0x10,
    0x40,

    /* U+4E2A "个" */
    0x0, 0x0, 0x80, 0x28, 0x8, 0x82, 0x4d, 0x88,
    0xc1, 0x0, 0x20, 0x4, 0x0, 0x80, 0x10, 0x0,

    /* U+4E2B "丫" */
    0xc1, 0xb1, 0x8d, 0x81, 0x80, 0x80, 0x40, 0x20,
    0x10, 0x8, 0x4, 0x0,

    /* U+4E2C "丬" */
    0x5, 0x16, 0x4d, 0x4, 0x33, 0x71, 0x4, 0x10,
    0x40,

    /* U+4E2D "中" */
    0x8, 0x4, 0x2, 0x1f, 0xf8, 0x8c, 0x47, 0xff,
    0x11, 0x8, 0x4, 0x2, 0x0,

    /* U+4E2E "丮" */
    0xff, 0x2, 0x20, 0x44, 0x7f, 0x81, 0x10, 0x22,
    0x3f, 0xc0, 0x88, 0x10, 0xe2, 0x18, 0x0, 0x0,

    /* U+4E2F "丯" */
    0x4, 0x0, 0xb0, 0x38, 0x72, 0x60, 0x70, 0x78,
    0x91, 0x60, 0x30, 0x7c, 0x0, 0x80, 0x10, 0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 192, .box_w = 11, .box_h = 1, .ofs_x = 0, .ofs_y = 4},
    {.bitmap_index = 2, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 16, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 30, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 44, .adv_w = 192, .box_w = 11, .box_h = 9, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 57, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 71, .adv_w = 192, .box_w = 11, .box_h = 7, .ofs_x = 0, .ofs_y = 2},
    {.bitmap_index = 81, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 95, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 111, .adv_w = 192, .box_w = 11, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 124, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 137, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 150, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 164, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 177, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 191, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 204, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 218, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 231, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 245, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 259, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 272, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 286, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 302, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 319, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 333, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 347, .adv_w = 192, .box_w = 12, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 362, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 376, .adv_w = 192, .box_w = 10, .box_h = 12, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 391, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 407, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 421, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 437, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 451, .adv_w = 192, .box_w = 11, .box_h = 10, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 465, .adv_w = 192, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 482, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 495, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 508, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 522, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 539, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 555, .adv_w = 192, .box_w = 1, .box_h = 11, .ofs_x = 5, .ofs_y = -1},
    {.bitmap_index = 557, .adv_w = 192, .box_w = 6, .box_h = 11, .ofs_x = 3, .ofs_y = -1},
    {.bitmap_index = 566, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 582, .adv_w = 192, .box_w = 9, .box_h = 10, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 594, .adv_w = 192, .box_w = 6, .box_h = 11, .ofs_x = 2, .ofs_y = -1},
    {.bitmap_index = 603, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 616, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 632, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -1}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/



 /*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 19968, .range_length = 48, .glyph_id_start = 1,
        .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR == 8
 /*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 1,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
    .cache = &cache
#endif
};



/*-----------------
 *  PUBLIC FONT
 *----------------*/

 /*Initialize a public general font descriptor*/
 #if LVGL_VERSION_MAJOR >= 8
 const lv_font_t font_s12 = {
 #else
 lv_font_t font_s12 = {
 #endif
     .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
     .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
     .line_height = 12,          /*The maximum line height required by the font*/
     .base_line = 2,             /*Baseline measured from the bottom of the line*/
 #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
     .subpx = LV_FONT_SUBPX_NONE,
 #endif
 #if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
     .underline_position = -1,
     .underline_thickness = 1,
 #endif
     .dsc = &font_dsc,          /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
 #if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
     .fallback = NULL,
 #endif
     .user_data = NULL,
 };



 #endif /*#if FONT_S12*/

